package com.example.cashier.model

import com.example.cashier.api.CashierApiService
import com.example.net.RetrofitUtils
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Qualifier
import javax.inject.Singleton

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class Cashier{

}
@Module
@InstallIn(SingletonComponent::class)
class CashierWorkModel {
    @Cashier
    @Provides
    @Singleton
    fun provideRetrofit(): Retrofit {
        return RetrofitUtils.getRetrofit()
    }
    @Provides
    @Singleton
    fun provideCarService(@Cashier retrofit: Retrofit): CashierApiService {
        return retrofit.create(CashierApiService::class.java)
    }
}